package com.minelx.serverandclient.connector;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class SocketTubes implements ITubes {

	private final Socket socket;

	public SocketTubes(Socket socket) {
		this.socket = socket;
	}

	@Override
	public InputStream in() {
		try {
			return socket.getInputStream();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public OutputStream out() {
		try {
			return socket.getOutputStream();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public void close() throws IOException {
		socket.close();
	}
}
